﻿<shared:WindowBase x:Class="Miris.HumanMilkAnalyser.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:shared="clr-namespace:Miris.HumanMilkAnalyser.WPF.Shared"
        xmlns:ignore="http://www.ignore.com"
        mc:Ignorable="d ignore"
        Icon="Skins/Resource/Icon/Bymed.ico"
        x:Name="CurrentWindow"
        WindowStartupLocation="CenterScreen"
        WindowStyle="None" 
        AllowsTransparency="True"
        WindowState="Normal"
        BorderBrush="White"
        BorderThickness="2"
        Height="730"
        Width="1366"
        Title="母乳分析系统"
        DataContext="{Binding Main, Source={StaticResource Locator}}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Window.Background>
        <ImageBrush ImageSource="/Skins/Resource/Image/MainWindowBackground.png" />
    </Window.Background>
    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <!-- Main Content -->
                <RowDefinition />
                <!-- Footer -->
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <!-- Cutomized System Buttons -->
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10">
                <Menu Background="Transparent">
                    <MenuItem>
                        <MenuItem.Header>
                            <Image Stretch="Fill" Source="/Skins/Resource/Image/Option.png" Width="35" />
                        </MenuItem.Header>
                        <MenuItem Header="检测结果" Command="{Binding GetAnalysisResultCommand}" />
                        <MenuItem Header="新建档案" Command="{Binding CreatePatientCommand}" />
                        <MenuItem Header="信息检索" Command="{Binding PatientDataSearchCommand}" />
                        <Separator />
                        <MenuItem Header="指导意见" Command="{Binding DiagnosticMessageReferenceSetupCommand}" />
                        <MenuItem Header="数据管理" Command="{Binding DataManagementCommand}" />
                        <MenuItem Header="自定义建议" Command="{Binding FurtherSuggestionCommand}" />
                        <MenuItem Header="系统设置" Command="{Binding BasicConfigurationCommand}" />
                        <Separator />
                        <MenuItem Header="系统帮助" Command="{Binding HelpCommand}" />
                        <MenuItem Header="注册许可" Command="{Binding RegistrationCodeCommand}" />
                    </MenuItem>
                </Menu>
                <Border Style="{StaticResource SystemButtonSeparatorBorder}" />
                <Button Tag="/Skins/Resource/Image/Minimize.png" Width="35" Style="{StaticResource OpacityImageButton}"  Click="BtnMinimize_Click" />
                <Border Style="{StaticResource SystemButtonSeparatorBorder}" />
                <Button Tag="/Skins/Resource/Image/Close.png"  Width="35" Style="{StaticResource OpacityImageButton}"  Click="BtnClose_Click" />
            </StackPanel>
            <Grid Margin="20,0,20,0">
                <Grid.RowDefinitions>
                    <!-- Title -->
                    <RowDefinition Height="Auto" />
                    <!-- Summary Message Display -->
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <!-- Main Frame -->
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <!-- Title -->
                <Image Margin="-22,0,0,0" HorizontalAlignment="Left" Source="/Skins/Resource/Image/SystemTitle.png" Width="530" MouseLeftButtonDown="Image_MouseLeftButtonDown" />
                <Grid Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border CornerRadius="4" BorderThickness="0" Background="White" Padding="5" Visibility="{Binding ErrorMessageVisibility}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Skins/Resource/Image/Error.png" Height="24" Width="24" />
                            <TextBlock Text="{Binding ErrorMessage}" ToolTip="{Binding ErrorMessage}" TextWrapping="Wrap"
                                       FontWeight="Bold" FontSize="22" Foreground="Red" HorizontalAlignment="Center" Margin="3" />
                        </StackPanel>
                    </Border>
                    <Border CornerRadius="4" Grid.Row="1" BorderThickness="0" Background="White" Padding="5" Visibility="{Binding SummaryMessageVisibility}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Skins/Resource/Image/Info.png" Height="24" Width="24" />
                            <TextBlock Text="{Binding SummaryMessage}" ToolTip="{Binding SummaryMessage}" TextWrapping="Wrap"
                                       FontWeight="Bold" FontSize="22" HorizontalAlignment="Center" Margin="3" />
                        </StackPanel>
                    </Border>
                </Grid>
                <StackPanel Grid.Row="2" Margin="0,2,0,8" Orientation="Horizontal" Width="1160">
                    <Button Margin="0,0,10,0" Content="检测结果" Style="{StaticResource RegularButton}" Command="{Binding GetAnalysisResultCommand}" />
                    <Button Margin="0,0,10,0" Content="新建档案" Style="{StaticResource RegularButton}" Command="{Binding CreatePatientCommand}" />
                    <Button Margin="0,0,10,0" Content="信息检索" Style="{StaticResource RegularButton}" Command="{Binding PatientDataSearchCommand}" />
                    <Button Margin="0,0,10,0" Content="指导意见" Style="{StaticResource RegularButton}" Command="{Binding DiagnosticMessageReferenceSetupCommand}" />
                    <Button Margin="0,0,10,0" Content="数据管理" Style="{StaticResource RegularButton}" Command="{Binding DataManagementCommand}" />
                    <Button Margin="0,0,10,0" Content="自定义建议" Style="{StaticResource RegularButton}" Command="{Binding FurtherSuggestionCommand}" />
                    <Button Margin="0,0,10,0" Content="系统设置" Style="{StaticResource RegularButton}" Command="{Binding BasicConfigurationCommand}" />
                    <Button Content="系统帮助" Style="{StaticResource RegularButton}" Command="{Binding HelpCommand}" />
                </StackPanel>
                <Frame x:Name="MainFrame" Grid.Row="3" NavigationUIVisibility="Hidden" Source="MainPage.xaml">
                    <!--<Frame.Style>
                        <Style TargetType="{x:Type Frame}">
                            <Setter Property="Visibility" Value="Visible" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding GenuineCheckPassed}" Value="False">
                                    <Setter Property="Visibility" Value="Collapsed" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Frame.Style>-->
                </Frame>
                <!--<Grid Grid.Row="3" Margin="0,40,0,0" Height="400" Background="#efefef">
                    <Grid.Style>
                        <Style TargetType="{x:Type Grid}">
                            <Setter Property="Visibility" Value="Collapsed" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding GenuineCheckPassed}" Value="False">
                                    <Setter Property="Visibility" Value="Visible" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding GenuineCheckResult}" FontSize="58" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    <TextBlock Grid.Row="1" Text="{Binding GenuineCheckDetail}" FontSize="36" HorizontalAlignment="Center" VerticalAlignment="Top" />
                </Grid>-->
            </Grid>
            <!-- Footer -->
            <Grid Grid.Row="1" TextBlock.FontSize="18" TextBlock.FontWeight="Light" Margin="0,0,0,10">
                <TextBlock Text="{Binding CurrentSystemDateTime}" Foreground="White" Margin="20,0,0,0" />
                <TextBlock Text="© 2013 Bymed" Foreground="White" Margin="0,0,20,0" HorizontalAlignment="Right" />
            </Grid>
        </Grid>
    </ScrollViewer>
</shared:WindowBase>
